//
//  UIDevice+SwichDirection.m
//  如何封装播放器
//
//  Created by clz on 2019/10/4.
//  Copyright © 2019 clz. All rights reserved.
//

#import "UIDevice+SwichDirection.h"

@implementation UIDevice (SwichDirection)

+ (void)switchNewOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    
    NSNumber *resetOrientationTarget = [NSNumber numberWithInt:UIInterfaceOrientationUnknown];
    
    [[UIDevice currentDevice] setValue:resetOrientationTarget forKey:@"orientation"];
    
    NSNumber *orientationTarget = [NSNumber numberWithInt:interfaceOrientation];
    
    [[UIDevice currentDevice] setValue:orientationTarget forKey:@"orientation"];
}

@end
